import React, { Component } from 'react'
import { Consumer } from './Count'

export default class ChildHood extends Component {
    render() {
        return (
            <div>
              <Consumer>
                {
                  ({count, increment}) => {
                    return(
                        <div>
                            <div>{count}</div>
                            <div>
                              <button onClick={() => increment(3)}></button>
                            </div> 
                        </div>
                    )
                  }
                }  
              </Consumer> 
            </div>
        )
    }
}
